package nGui.controls.containers;

import nGui.controls.Control;

class Frame extends Control
{
	public var fgColor(null,setFgColor) : Int;
	public var margin(null,setMargin) : Int;
	public var title(null,setTitle) : String;

	public function new( item : Void )
	{
		super();
		__c = ngui_frame( item );
	}

	private function setFgColor( val : Int )
	{
		var r : Int = (val & 0xFF0000) >> 16;
		var g : Int = (val & 0x00FF00) >> 8;
		var b : Int = val & 0x0000FF;
		this.setAttribute( "FGCOLOR", Std.string(r)+" "+Std.string(g)+" "+Std.string(b) );
		return null;
	}

	private function setTitle( val : String )
	{
		this.setAttribute( "TITLE", val );
		return null;
	}

	private function setMargin( val : Int )
	{
		this.setAttribute( "MARGIN", val+"" );
		return null;
	}

	static var ngui_frame = neko.Lib.load("nGui","ngui_element_frame",1);
}